package com.syf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.injector.methods.SelectById;
import com.baomidou.mybatisplus.core.injector.methods.SelectOne;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.syf.mapper.UserAuthAuditRecordMapper;
import com.syf.domain.UserAuthAuditRecord;
import com.syf.service.UserAuthAuditRecordService;
/**
*
*
*@author 苏耀奋
*@create 2021-08-02 14:28
*/
@Service
public class UserAuthAuditRecordServiceImpl extends ServiceImpl<UserAuthAuditRecordMapper, UserAuthAuditRecord> implements UserAuthAuditRecordService{

    @Autowired
    UserAuthAuditRecordMapper userAuthAuditRecordMapper;
    /**
     * 获取一个用户的审核记录
     * @param id
     * @return
     */
    @Override
    public List<UserAuthAuditRecord> getUserAuthAuditRecordList(Long id) {
        return list(new LambdaQueryWrapper<UserAuthAuditRecord>()
                .eq(id!=null,UserAuthAuditRecord::getUserId,id)
                .orderByDesc(UserAuthAuditRecord::getCreated)
                .last("limit 3")

        );
    }
}
